jQuery(function() {
	updateText("fr");
});

function updateText(language) {
	var url;
	if(language == "fr") {
		url = "i18n/fr/index.json";
	}else if (language == "de") {
		url = "http://127.0.0.1/Deux_Amis/i18n/de/index.json";
	} else {
		url = "i18n/en/index.json";
	}
	jQuery('#lang_manager').load('session_write.php?session_key='+key+'&session_value='+language);
	jQuery.ajax(url, {
		dataType: "text",
		success: function(data) {
			var toJSON = $.parseJSON(data);
			console.log(toJSON);
			jQuery("#enterWebSite").text(toJSON.submit);
		},
		error: function(jqXHR, textStatus, errorThrown) {
			console.log(textStatus); //error logging
		}
	});
}
